package com.hhb.service.impl;

import com.hhb.mapper.UserMapper;
import com.hhb.model.User;
import com.hhb.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service("userService")
@Transactional
public class UserServiceImpl implements UserService {

    @Autowired
    private UserMapper userMapper;

    @Override
    public List<User> findAll() {

        System.out.println("业务层……查询所有用户——成功！");
        return userMapper.findAll();
    }

    @Override
    public void save(User user) {
        userMapper.save(user);
    }
}
